package cn.xx.basic.query;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class BaseQuery {
    //当前页
    private Integer currentPage = 1;
    //每页显示的条数
    private Integer pageSize = 5;

    private String keyword = null;

    /**
     * limit a,b
     * a - 当前页的起始下标
     * b = pageSize
     */
    //计算limit的第一个参数：方便xml中直接获取
    public Integer getBegin() {
        return (this.currentPage - 1) * this.pageSize;
    }
}
